package com.yy.jhl.api;

import com.alibaba.fastjson.serializer.ObjectSerializer;
import com.yy.common.basebean.BaseResponse;
import com.yy.jhl.bean.LoginInfo;

import org.json.JSONObject;

import java.util.Map;

import okhttp3.FormBody;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Part;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;
import rx.Observable;

/**
 * des:ApiService
 * Created by xsf
 * on 2016.06.15:47
 */
public interface ApiService {

    /**
     * 邀请码登录
     *
     * @return
     */
    @POST("v1/invites/login")
    Observable<ResponseBody> invitesLogin(@Body RequestBody requestBody);

    /**
     * 登录
     *
     * @return
     */
    @POST("v1/users/login")
    Observable<ResponseBody> login(@Body RequestBody requestBody);
    /**
     * 退出
     *
     * @return
     */
    @POST("v1/users/logout")
    Observable<ResponseBody> logout(@Body RequestBody requestBody);
    /**
     * 发送短信验证码
     *
     * @return
     */
    @PUT("v1/users/signup")
    Observable<ResponseBody> sendCode(@Body RequestBody requestBody);
    /**
     * 注册
     *
     * @return
     */
    @PUT("v1/users/signup")
    Observable<ResponseBody> register(@Body RequestBody requestBody);
    /**
     * 获取用户信息
     *
     * @return
     */
    @GET("v1/users/info")
    Observable<ResponseBody> getUserInfo(@Query("id") String id);
    /**
     * 修改密码
     *
     * @return
     */
    @PUT("v1/users/resetpwd")
    Observable<ResponseBody> modifyPwd(@Body RequestBody requestBody);
    /**
     * 找回密码
     *
     * @return
     */
    @PUT("v1/users/forgot")
    Observable<ResponseBody> forgetPwd(@Body RequestBody requestBody);
    /**
     * 绑定手机号
     *
     * @return
     */
    @PUT("v1/users/bind")
    Observable<ResponseBody> bindPhone(@Body RequestBody requestBody);
    /**
     * 绑定手机号
     *
     * @return
     */
    @PUT("v1/messages/mread")
    Observable<ResponseBody> setMessageReaded(@Body RequestBody requestBody);
    /**
     * 消息列表
     *
     * @return
     */
    @GET("v1/messages/list")
    Observable<ResponseBody> getMessageList(@Query("start") int start,@Query("limit") int limit,@Query("is_history") int is_history);
    /**
     * 项目列表
     *
     * @return
     */
    @GET("v1/projects/list")
    Observable<ResponseBody> getProjectList(@QueryMap Map<String, Object> map);
    /**
     * 项目详情
     *
     * @return
     */
    @GET("v1/projects/info")
    Observable<ResponseBody> getProjectDetail(@Query("id") String id);
    /**
     * 消息未读数
     *
     * @return
     */
    @GET("v1/messages")
    Observable<ResponseBody> getMessageUnreadNum();
    /**
     *
     * @return
     */
    @GET("v1/invites/order")
    Observable<ResponseBody> getInviteBatch();
    /**
     *
     * @return
     */
    @GET("v1/invites/package")
    Observable<ResponseBody> getInvitePackage(@Query("package_code") String id);
    /**
     *
     * @return
     */
    @GET("v1/invites/uprecord")
    Observable<ResponseBody> getUploadHistory(@Query("pack_num") String id);
    /**
     *
     * @return
     */
    @PUT("v1/invites/check")
    Observable<ResponseBody> checkInfo(@Body RequestBody requestBody);
    /**
     *
     * @return
     */
    @GET("v1/invites/uprecord")
    Observable<ResponseBody> getUploadHistory();

    /**
     *
     * @return
     */
    @POST("v1/invites/upload")
    Observable<ResponseBody> uploadInfo(@Body RequestBody requestBody);

    /**
     *文件上传
     * @return
     */
    @POST("v1/defaults/upload")
    Observable<ResponseBody> uploadImage(@Body RequestBody requestBody);

    //--------------------采购商----------------//
    /**
     *项目订单列表
     * @return
     */
    @GET("v1/projects/order")
    Observable<ResponseBody> cgsGetOrderList(@QueryMap Map<String, Object> map);
    /**
     *项目订单完结
     * @return
     */
    @PUT("v1/projects/renew")
    Observable<ResponseBody> cgsDoneOrder(@Body RequestBody requestBody);
    /**
     *监管订单列表
     * @return
     */
    @GET("v1/orders/list")
    Observable<ResponseBody> cgsGetJGOrderList(@QueryMap Map<String, Object> map);
    /**
     *监管订单详情
     * @return
     */
    @GET("v1/orders/info")
    Observable<ResponseBody> cgsGetJGOrderDetail(@Query("id") String id);
    /**
     *监管流程
     * @return
     */
    @GET("v1/orders/flow")
    Observable<ResponseBody> cgsGetJGOrderFlow(@Query("id") String id);
    /**
     *物流监管批次列表
     * @return
     */
    @GET("v1/batches/list")
    Observable<ResponseBody> cgsGetJGBatchList(@QueryMap Map<String, Object> map);
    /**
     *物流监管
     * @return
     */
    @GET("v1/batches/info")
    Observable<ResponseBody> cgsGetJGBatchDetail(@Query("id") String id);
    /**
     *箱子列表
     * @return
     */
    @GET("v1/packages/list")
    Observable<ResponseBody> cgsGetPackageList(@Query("batch_id") String id);
    /**
     *箱子产品列表
     * @return
     */
    @GET("v1/packages/items")
    Observable<ResponseBody> getBoxPackageList(@Query("id") String batch_id,@Query("package_id") String package_id);
    /**
     *订单列表
     * @return
     */
    @GET("v1/orders/items")
    Observable<ResponseBody> gysGetProductList(@Query("id") String order_id,@Query("batch_id") String batch_id);
    /**
     *国内货代，国外货代，到货验收
     * @return
     */
    @GET("v1/packages/record")
    Observable<ResponseBody> getContractsInfo(@Query("batch_id") String batch_id,@Query("address_id") String address_id);

    /**
     *出库准备，出库
     * @return
     */
    @PUT("v1/batches/renew")
    Observable<ResponseBody> gysChuKu(@Body RequestBody requestBody);

    /**
     *出库审核
     * @return
     */
    @PUT("v1/batches/check")
    Observable<ResponseBody> cgsChuKuCheck(@Body RequestBody requestBody);
    /**
     *箱子删除
     * @return
     */
    @POST("v1/packages/remove")
    Observable<ResponseBody> removePackage(@Body RequestBody requestBody);
    /**
     *箱子编辑
     * @return
     */
    @PUT("v1/packages/renew")
    Observable<ResponseBody> modifyPackage(@Body RequestBody requestBody);
    /**
     *功能介绍列表
     * @return
     */
    @GET("sites/versions")
    Observable<ResponseBody> getFunctionList(@QueryMap Map<String, Object> map);
    /**
     *版本更新
     * @return
     */
    @GET("sites/version")
    Observable<ResponseBody> updateApk(@QueryMap Map<String, Object> map);
    /**
     * 收藏列表
     *
     * @return
     */
    @GET("v1/collects/list")
    Observable<ResponseBody> getCollectList(@QueryMap Map<String, Object> map);
    /**
     * 添加收藏
     *
     * @return
     */
    @PUT("v1/collects/renew")
    Observable<ResponseBody> addCollect(@Body RequestBody requestBody);
    /**
     * 取消收藏
     *
     * @return
     */
    @POST("v1/collects/remove")
    Observable<ResponseBody> removeCollect(@Body RequestBody requestBody);
}

